-
Notifications
You must be signed in to change notification settings - Fork 767
CB-7684: (iOS) Fix CDVSound killing all audio when a single file finishes #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
What about this? Would it be possible to have a comment or an opinion? |
@cordova-qa +1 on this. |
It looks like this fix includes the pull request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have integared this patch into version 2.4.0 and tested playback with iOS10. It works.
This issue is still on version 3.0.0 -- I am not sure if all setActive:NO should be commented out -- it seems that there is some logic to kill the audio playback when recording? I'd much prefer a stable version update than to do my own hacking... what can I do to help? |
Sending setActiveNo: to an audio session will always stop recording and playback. This is how the system handles incoming phonecalls etc.
Probably you are out of luck for waiting it out, unless you have a year or so. This PR and another that fixes that Audio is disabled after every memory warning are open for ages (#120). I apply the patches manually like this:
|
I've just submitted a #143 PR that solves the issue implementing an |
Hello, I have a similar problem for ages : after I record an audio, I can't play any other audio files (using default HTML5 audio feature). I have succeed to fix this issue by doing a bit more work than you did. |
+1. have the changes been merged? I test it and it worked for me. I forked this repo and publish ( Thanks All |
@damienleroux This PR has a merge conflict. It would probably be better for you to send a new PR with the required changes. You can reference this one so we can close it as well. |
@macdonst Is there any realistic chance that the new PR will be merged contemporary and not ignored for another year? |
Done: #162. Thank you :) |
@damienleroux, @macdonst are you talking about my #143 being merged? If so, I've just updated my PR to fix merge conflicts that were related to plugin.xml only. Please, let me know. |
@adriano-di-giovanni I didn't see you submit a PR for this issue. May be more relevant that the commit from@tbrebrant that solves the issue: I don't know. |
@damienleroux It's the #143. Did I make any mistakes? I think it's a valid alternative to the one from @tbrebant. It's also backward compatible. Please, let me know. |
@adriano-di-giovanni. I can't say if you made mistakes or not. Besides, @macdonst, my PR #162 seems to fail travis integration tests but don't know why. |
@damienleroux Pretty sure it's an environment bug and has nothing to do with your commit: https://travis-ci.org/apache/cordova-plugin-media/jobs/324476963#L1534 |
Platforms affected
iOS
What does this PR do?
We arrived to the same conclusion as Nathan Stryker on Jira (https://issues.apache.org/jira/browse/CB-7684) and @ionut-movila in the PR #33 : all
self.avSession setActive:NO
should be removed.The problem was not only that when a media finishes it is stopping other ones played by the plugin, but it is also killing any sound played by another plugin or by WebView's default webaudio system, triggering a descriptive:
We found that
AVAudioSession
is a singleton for the whole app (cf. https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioSession_ClassReference/).Apple says:
(cf. https://developer.apple.com/library/ios/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/ConfiguringanAudioSession/ConfiguringanAudioSession.html)
What testing has been done on this change?
Ran the integrated tests. Before doing any change (version 2.3.1-dev) the result was:
After the change the result is exactly the same:
All tests was made with an iPad2 on iOS8.4.
Before merging, it would be great if someone can test:
Checklist
About the last point: I don't see what kind of tests we can add for this fix.